<template>
	<div style="padding: 8px;background-color: #F5F5F5;padding-right: 0px;">
		<div class="yunui-nav-section">
			<div class="yunui-section-header" style="position: relative;">
				<div class="yunui-section-title">最近{{moduleName}}</div>
				<i class="el-icon-plus" style="position: absolute;right:5px;top:14px;cursor: pointer;" @click="onPlusClickHadler"></i>
			</div>
			<div>
				<div v-for="(item,index) in recentList" :key="index" class="recent-list-class"
					@click="this.$emit('itemClick',item)">
					<img src='../../../assets/menu-item.png' style="width:28px;height:28px;" />
					<span style="display: inline-block;margin-left: 10px;">{{item.name}}</span>
				</div>
			</div>
		</div>
		<ModelWizardDialog ref="modelWizardDialog"></ModelWizardDialog>
		<ReportWizardDialog ref="reportWizardDialog"></ReportWizardDialog>
		<PageWizardDialog ref="pageWizardDialog"></PageWizardDialog>
		<WorkflowWizardDialog ref="workflowWizardDialog"></WorkflowWizardDialog>
	</div>
</template>

<script>
	import ModelWizardDialog from "./wizard/model/ModelWizardDialog.vue";
	import ReportWizardDialog from "./wizard/report/ReportWizardDialog.vue";
	import PageWizardDialog from "./wizard/page/PageWizardDialog.vue";
	import WorkflowWizardDialog from "./wizard/workflow/WorkflowWizardDialog.vue";
	export default {
		name: 'RecentList',
		props: ["moduleName", "recentList","moduleValue"],
		components: {
			ModelWizardDialog,ReportWizardDialog,PageWizardDialog,WorkflowWizardDialog
		},methods: {
			onPlusClickHadler() {
				if(this.moduleValue=="model"){
					this.$refs.modelWizardDialog.setVisible(true);
					this.$refs.modelWizardDialog.init();
				}else if(this.moduleValue=="report"){
					this.$refs.reportWizardDialog.setVisible(true);
					this.$refs.reportWizardDialog.init();
				}else if(this.moduleValue=="page"){
					this.$refs.pageWizardDialog.setVisible(true);
					this.$refs.pageWizardDialog.init();
				}else if(this.moduleValue=="workflow"){
					this.$refs.workflowWizardDialog.setVisible(true);
					this.$refs.workflowWizardDialog.init();
				}
			}
		},
	}
</script>

<style>
	
</style>
